import axios, { AxiosResponse, AxiosRequestConfig,InternalAxiosRequestConfig,AxiosResponseTransformer } from 'axios';
// 暂时不用 换封装的自己在网上找 具体看 https://juejin.cn/post/7079785777692934174#heading-23
const service = axios.create();
//  [AxiosRequestConfig]爆红线 可以用 [InternalAxiosRequestConfig]
// Request interceptors
service.interceptors.request.use(
    (config: InternalAxiosRequestConfig) => {
        // do something
        return config;
    },
    (error: any) => {
        Promise.reject(error);
    }
);

// Response interceptors
service.interceptors.response.use(
    async (response: AxiosResponse) => { 
        return response
    },
    (error: any) => {
        // do something
        return Promise.reject(error);
    }
);

export default service;